package com.cloud.pojo.sys;


import com.cloud.constant.Constants;

public class Result {
    private Integer resultCode;
    private String tipMsg;
    private Object resultObj;

    public static Result createSuccess(String msg) {
       return new Result().setResultCode(Constants.SUCCESS).setTipMsg(msg);
    }

    public static Result createSuccess(String msg, Object obj) {
        return new Result().setResultCode(Constants.SUCCESS).setTipMsg(msg).setResultObj(obj);
    }

    public static Result createFail(String msg) {
        return new Result().setResultCode(Constants.FAIL).setTipMsg(msg);
    }

    public static Result createFail(Integer resultCode, String msg) {
        return new Result().setResultCode(resultCode).setTipMsg(msg);
    }

    public static Result createFail(String msg, Object obj) {
        return new Result().setResultCode(Constants.FAIL).setTipMsg(msg).setResultObj(obj);
    }

    public Integer getResultCode() {
        return resultCode;
    }

    public Result setResultCode(Integer resultCode) {
        this.resultCode = resultCode;
        return this;
    }

    public String getTipMsg() {
        return tipMsg;
    }

    public Result setTipMsg(String tipMsg) {
        this.tipMsg = tipMsg;
        return this;
    }

    public Object getResultObj() {
        return resultObj;
    }

    public Result setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
